﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HustQQClient.UI
{
    public partial class GroupInfoBlock : UserControl
    {
        public delegate void EnterEventHandler(string teamId);
        public event EnterEventHandler BeginTeam;

        private string groupId = "GroupID";
        public string GroupId
        {
            get { return groupId; }
            set 
            { 
                groupId = value.Trim();
                labelGroup.Text = groupName + "(" + groupId + ")";
            }
        }

        private string groupName = "GroupName";
        public string GroupName
        {
            get { return groupName; }
            set 
            { 
                groupName = value;
                labelGroup.Text = groupName + "(" + groupId + ")";
            }
        }

        public GroupInfoBlock()
        {
            InitializeComponent();
        }

        #region DoubleClick事件
        private void GroupInfoBlock_DoubleClick(object sender, EventArgs e)
        {
            if (BeginTeam != null)
                BeginTeam(GroupId);
        }
        private void labelGroup_DoubleClick(object sender, EventArgs e)
        {
            GroupInfoBlock_DoubleClick(this, e);
        }
        private void picOpened_DoubleClick(object sender, EventArgs e)
        {
            GroupInfoBlock_DoubleClick(this, e);
        }
        #endregion

        //public void Open()
        //{
        //    picOpened.Image = new Bitmap("open.jpg");
        //}

        //public void Close()
        //{
        //    picOpened.Image = new Bitmap("close.jpg");
        //}
    }
}
